using System;
using Castle.ActiveRecord;

namespace IronMis2.Models
{
    [ActiveRecord("bank_bussess")]
    public class BankBussess : ActiveRecordBase<BankBussess>
    {
        private Guid id;
        private decimal total;
        private string outAccount;
        private string inAccount;
        private string ticketNumber;
        private string summary;
        private Employee employee;
        private DateTime? date;

        [Property(Column = "bank_date", SqlType = "datetime",Length = 8)]
        public DateTime? Date
        {
            set { date = value; }
            get { return date; }
        }

        [PrimaryKey(PrimaryKeyType.GuidComb, Column = "id")]
        public Guid Id
        {
            set { id = value; }
            get { return id; }
        }

        [BelongsTo(Column = "s_number", ForeignKey = "id",Insert = true,Update=true, Fetch = FetchEnum.Select)]
        public Employee Employee
        {
            set { employee = value; }
            get { return employee; }
        }

        [Property(Column = "total", SqlType = "decimal", Length = 9)]
        public decimal Total
        {
            set { total = value; }
            get { return total; }
        }

        [Property(Column = "out_account", SqlType = "char", Length = 19)]
        public string OutAccount
        {
            set { outAccount = value; }
            get { return outAccount; }
        }

        [Property(Column = "in_account", SqlType = "char", Length = 19)]
        public string InAccount
        {
            set { inAccount = value; }
            get { return inAccount; }
        }

        [Property(Column = "ticket_number", SqlType = "char", Length = 10)]
        public string TicketNumber
        {
            set { ticketNumber = value; }
            get { return ticketNumber; }
        }

        [Property(Column = "summary", SqlType = "varchar", Length = 50)]
        public string Summary
        {
            set { summary = value; }
            get { return summary; }
        }
    }
}
